<div class="content-box"><!-- Start Content Box -->
				
	<div class="content-box-header">
					
		<h3>Editar assembleia</h3>
					
		<?php if( isset($condominio_id) ) { ?>
				<img src="<?php echo Kohana::$base_url; ?>/resources/images/home.png" class="addRegistry" onclick="javascript: update('<?php echo Kohana::$base_url; ?>assembleia/list/?condominio_id=<?=$condominio_id?>','assembleias', null);" />
		<?php } ?>
					
		<div class="clear"></div>
					
	</div> <!-- End .content-box-header -->
				
	<div class="content-box-content">
					
		<div class="tab-content default-tab" id="tab2">
					
			<form action="<?php echo Kohana::$base_url; ?>assembleia/save" id="formAddassembleia" method="post">
			
				<input type="hidden" id="id" name="id" value="<?php echo $assembleia->id; ?>" />
							
				<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td bgcolor="#FFFFFF" style="width:50%;">
								<label>Título</label>
								<input class="text-input" style="width:100%;" type="text" id="titulo" name="titulo" value="<?php echo $assembleia->titulo ?>" />
							</td>
							<td bgcolor="#FFFFFF">
								<label>Data</label>
								<input class="text-input" style="width:100%;" type="text" id="data" name="data" value="<?php echo $assembleia->data ?>" />
							</td>
							<td bgcolor="#FFFFFF">
								<label>Hora</label>
								<input class="text-input" style="width:100%;" type="text" id="hora" name="hora" value="<?php echo $assembleia->hora ?>" />
							</td>
							<td bgcolor="#FFFFFF" style="width:30%;">
								<label>Local</label>
								<input class="text-input" style="width:100%;" type="text" id="local" name="local" value="<?php echo $assembleia->local ?>" />
							</td>
						</tr>
						<tr>
							<td bgcolor="#FFFFFF" colspan="4">
								<label>Descrição</label>
								<textarea class="text-input" style="width:100%;" id="descricao" name="descricao"><?php echo $assembleia->descricao ?></textarea>
							</td>
						</tr>
						<?php if( isset($condominio_id) ) { ?>
						
							<input type="hidden" id="condominio_id" name="condominio_id" value="<?php echo $condominio_id; ?>" />
						
						<?php }else { ?>
						
							<tr>
								<td bgcolor="#FFFFFF" colspan="6">
									<label>Condomínio</label>
									<select id="condominio_id" name="condominio_id">
										<?php 
											foreach ($condominios as $condominio){
												echo "<option value=\"$condominio->id\">$condominio->nome</option>";
											} 
										?>
									</select>
								</td>
							</tr>
							
						<?php } ?>
						
						<tr>
							<td bgcolor="#FFFFFF" colspan="6">
								<input class="button" type="submit" value="Editar">
							</td>
						</tr>
					</table>
					<br />
					
				</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
						
				<?php if( isset($condominio_id) ) { ?>
				
					<script type="text/javascript">

						jQuery("#formAddassembleia").submit(function() {
		                        
						        var data = $(this).serialize(); // Dados do formulário     
		
						        // Envia o formulário via Ajax
						        $.ajax({
						                type: "POST",
						                url: this.action,
						                data: data,
						                cache: false,
						                success: function(returned)
						                {
						                        $("#assembleias").html(returned);
						                },
						                error:function(XMLHttpRequest, textStatus, errorThrown)
						                {
						                        alert("EITA: malassombro");
						                }
						        });
						        return false; // Previne o form de ser enviado pela forma normal
						});

					</script>
					
				<?php } ?>
						
					</div> <!-- End #tab2 -->        
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
